<div class="content-header">
    <h2 class="content-title">商品管理</h2>
    <span class="layui-breadcrumb">
	  <a href="#!home" class="black">首页</a>
	  <a><cite>商品管理</cite></a>
	</span>
</div>

<div>
    <div class="layui-form toolbar">
        搜索：
        <select id="searchKey">
            <option value="">-请选择-</option>
            <option value="pk_id">商品ID</option>
            <option value="category">商品种类</option>
            <option value="name">商品名</option>
            <option value="user_id">用户ID</option>
        </select>&emsp;
        <input id="searchValue" class="layui-input search-input" type="text" placeholder="输入搜索内容"/>&emsp;
        <button id="searchBtn" class="layui-btn search-btn"><i class="layui-icon">&#xe615;</i>搜索</button>&emsp;
    </div>

    <table class="layui-table" id="table" lay-filter="table"></table>
</div>

<!-- 表单弹窗 -->
<script type="text/html" id="addModel">
    <form id="editForm" class="layui-form model-form" action="">

        <!--<div class="layui-form-item">-->

        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-inline">
                <input type="text" name="name" required lay-verify="required" placeholder="请输入商品名称"
                       autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">价格</label>
            <div class="layui-input-inline">
                <input type="text" name="price" required lay-verify="required" placeholder="价格"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">种类</label>
            <div class="layui-input-inline">
                <select id="selCategory" name="category" lay-verify="required">
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">交易地址</label>
            <div class="layui-input-inline">
                <input type="text" name="location" required lay-verify="required" placeholder=""
                       autocomplete="off" class="layui-input">
            </div>
        </div>


        <input type="hidden" name="id">
        <div class="layui-form-item layui-input-block">
            <button class="layui-btn layui-btn-primary" type="button" id="btnCancel">取消</button>
            <button class="layui-btn" lay-filter="btnSubmit" lay-submit>保存</button>
        </div>
    </form>
</script>
<!-- 表格操作列 -->
<script type="text/html" id="barTpl">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">编辑</a>
    <!--<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>-->
</script>
<!--种类选择模板-->
<script type="text/html" id="selectCategoryTpl">
    <option value="">-请选择-</option>
    {{# layui.each(d.list,function(index,item){  }}
    <option value="{{ item.name }}">{{ item.name }}</option>
    {{# });  }}
</script>
<script type="text/javascript" src="../../js/admin/goods.js"></script>
